Skip to content

ANSTRAT-1683 Support Kubernetes Job specs in addition to Pod specs#1428

Open
CastawayEGR wants to merge 1 commit intoansible:develfrom
CastawayEGR:support-job-specs
Open

ANSTRAT-1683 Support Kubernetes Job specs in addition to Pod specs#1428
CastawayEGR wants to merge 1 commit intoansible:develfrom
CastawayEGR:support-job-specs

Conversation

@CastawayEGR
Copy link
Copy Markdown

This PR adds support for Kubernetes Job specs in addition to Pod specs to enable compatibility with cluster autoscaler.

Kubernetes cluster autoscaler cannot properly taint and drain nodes when automation jobs are backed by standalone Pod objects. The cluster autoscaler requires controller-backed objects (like Jobs, Deployments, etc.) to safely evict workloads during node scaling operations. Without this, automation jobs using plain Pod specs block the tainting of nodes thus preventing efficient cluster scaling.

With this PR, receptor has been enhanced with the following changes:

  • Parse YAML specs and automatically handle both Job and Pod resource types
  • Create and manage Kubernetes Job resources with proper cleanup
  • Wait for Job controller to create pods before proceeding with execution
  • Clean up both Job and Pod resources when work units are cancelled
  • Existing Pod specs continue to work unchanged

  - Add Job creation and lifecycle management
  - Detect Job vs Pod specs automatically
  - Wait for Job to create pods before proceeding
  - Clean up Jobs on cancellation
  - Refactor pod creation logic to handle both types
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant